package com.cskaoyan.javase.oop2._1extends._9override._0introduction;
/**
 * 方法的覆盖
 * @since 10:12
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
        new Cat().shout();
        Animal a = new Cat();
        a.shout();

        new Cat().test();

        new Cat().superShout();
    }
}
class Animal{
    public void shout(){
        System.out.println("动物都会叫!");
    }

    public void test(){
        shout();
    }
}
class Cat extends Animal{
    public void shout(){
        System.out.println("喵喵喵!");
    }

    public void superShout(){
        super.shout();
    }
}